package June;

import java.util.Scanner;

public class Test05RMBConverter02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int money = sc.nextInt();
        converter(money);
    }

    //方法名应该用小写字母开头
    public static void converter(int m) {
        String[] majuscule = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
        String[] unit = {"拾", "亿", "仟", "佰", "拾", "万", "仟", "佰", "拾", "元"};
        //设置temp为键盘录入的数字的长度
        int temp = 0;
        int ma=m;
        while (ma > 0) {
            //获得个位数赋值给ge
            int ge = ma % 10;
            //去掉最后一个数
            ma = ma / 10;
            temp++;
        }
        System.out.println("输入的数字的长度为：" + temp+",现在m的值为"+m);

        int[] num=new int[temp];
        for (int i = num.length - 1; i >= 0; i--) {
            num[i]=m%10;
            m=m/10;
        }
        String money_han = "";
        for (int i = 0; i < temp; i++) {
            money_han=money_han+majuscule[num[i]];
        }
        int le=unit.length-num.length;
        String money_unit="";
        for (int i = le; i < unit.length; i++) {
            money_unit=money_unit+unit[i];
        }
        boolean p=true;
        for (int i = 0; i < temp; i++) {
            char mh=money_han.charAt(i);
            char mu=money_unit.charAt(i);
            if (money_han.charAt(i)=='零') {
                while (p){
                    System.out.print('零');
                    p=false;
                }
            }else {
                System.out.print(mh);
                System.out.print(mu);
            }

        }

    }


}
